#include <bits/stdc++.h>
// 2025/07/16
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;

// 20 16 12 17 14 11 15 12 

struct node
{
    int f, d;
    bool operator<(const node& rhs) const
    {
        if (f != rhs.f)
            return f < rhs.f;
        return d > rhs.d;
    }
} p[26];
int n, h;

int solve(int x, int t){
    int ans = 0;
    priority_queue<node> pq;
    for (int i = 1; i <= x; i++)
        pq.push(p[i]);
    while (t > 0 && pq.top().f > 0) {
        node u = pq.top();
        pq.pop();
        ans += u.f;
        t--;
        u.f -= u.d;
        pq.push(u);
    }
    return ans;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> h;
    h *= 12;
    priority_queue<node> pq;
    for (int i = 1; i <= n; i++)
        cin >> p[i].f;
    for (int i = 1; i <= n; i++)
        cin >> p[i].d;
    int ans = solve(1, h);
    for (int i = 1; i < n; i++) {
        int t;
        cin >> t;
        h -= t;
        ans = max(ans, solve(i + 1, h));
    }
    cout << ans << endl;
    return 0;
}